Character classes are more convenient than sub-matches for matching from a range of characters at one position in a pattern. There are two ways to specify a character class: square brackets or the special backslash options. See the following sections: